// 员工
import request from '@/utils/request.js'

/**
 * 获取员工简单列表
 * @returns
 */
export const getEmployeesSimple = () => {
  return request({
    url: '/sys/user/simple'
  })
}

/**
 * 获取员工列表
 * @returns params:{page:页码, size:每页条数 }
 */
export const getEmployeesList = (params) => {
  return request({
    url: '/sys/user',
    params
  })
}

/**
 * 新增员工
 * @returns data
 */
export const addEmployeesData = (data) => {
  return request({
    url: '/sys/user',
    method: 'POST',
    data
  })
}

/**
 * 批量导入员工
 * @returns data
 */
export const importEmployeesData = (data) => {
  return request({
    url: '/sys/user/batch',
    method: 'POST',
    data
  })
}

/**
 * 获取员工岗位信息
 * @returns data
 */
export const getEmployeesData = (id) => {
  return request({
    url: `/employees/${id}/jobs`,
    method: 'GET'
  })
}

/**
 * 保存员工岗位信息
 * @returns data
 */
export const updateEmployeesData = (id, data) => {
  return request({
    url: `/employees/${id}/jobs`,
    method: 'PUT',
    data
  })
}
